<?php


class BuActivityLog extends CActiveRecord
{
	
	public static function model($Vgmajjibziuy=__CLASS__)
	{
		return parent::model($Vgmajjibziuy);
	}

	
	public function tableName()
	{
		return 'bu_activity_log';
	}

	
	public function rules()
	{
		
		
		return array(
			array('backend_user_id, bu_session_id', 'numerical', 'integerOnly'=>true),
			array('controller, action, server_name', 'length', 'max'=>200),
			array('server_ip, server_protocol, request_method, client_ip, client_host, client_port', 'length', 'max'=>45),
			array('user_agent, referer', 'length', 'max'=>500),
			array('bu_name', 'length', 'max'=>100),
			array('params, request_time, raw_url', 'safe'),
			
			
			array('id, backend_user_id, controller, action, params, server_ip, server_name, server_protocol, request_method, request_time, user_agent, referer, client_ip, client_host, client_port, bu_session_id, raw_url, bu_name', 'safe', 'on'=>'search'),
		);
	}

	
	public function relations()
	{
		
		
		return array(
			'backendUser' => array(self::BELONGS_TO, 'BackendUser', 'backend_user_id'),
			'buSession' => array(self::BELONGS_TO, 'BuSession', 'bu_session_id'),
		);
	}

	
	public function attributeLabels()
	{
		return array(
			'id' => 'ID',
			'backend_user_id' => 'Backend User',
			'controller' => 'Controller',
			'action' => 'Action',
			'params' => 'Params',
			'server_ip' => 'Server Ip',
			'server_name' => 'Server Name',
			'server_protocol' => 'Server Protocol',
			'request_method' => 'Request Method',
			'request_time' => 'Request Time',
			'user_agent' => 'User Agent',
			'referer' => 'Referer',
			'client_ip' => 'Client Ip',
			'client_host' => 'Client Host',
			'client_port' => 'Client Port',
			'bu_session_id' => 'Bu Session',
			'raw_url' => 'Raw Url',
			'bu_name' => 'Bu Name',
		);
	}

	
	public function search()
	{
		
		

		$V0v5vsnfxezw=new CDbCriteria;

		$V0v5vsnfxezw->compare('id',$this->id);
		$V0v5vsnfxezw->compare('backend_user_id',$this->backend_user_id);
		$V0v5vsnfxezw->compare('controller',$this->controller,true);
		$V0v5vsnfxezw->compare('action',$this->action,true);
		$V0v5vsnfxezw->compare('params',$this->params,true);
		$V0v5vsnfxezw->compare('server_ip',$this->server_ip,true);
		$V0v5vsnfxezw->compare('server_name',$this->server_name,true);
		$V0v5vsnfxezw->compare('server_protocol',$this->server_protocol,true);
		$V0v5vsnfxezw->compare('request_method',$this->request_method,true);
		$V0v5vsnfxezw->compare('request_time',$this->request_time,true);
		$V0v5vsnfxezw->compare('user_agent',$this->user_agent,true);
		$V0v5vsnfxezw->compare('referer',$this->referer,true);
		$V0v5vsnfxezw->compare('client_ip',$this->client_ip,true);
		$V0v5vsnfxezw->compare('client_host',$this->client_host,true);
		$V0v5vsnfxezw->compare('client_port',$this->client_port,true);
		$V0v5vsnfxezw->compare('bu_session_id',$this->bu_session_id);
		$V0v5vsnfxezw->compare('raw_url',$this->raw_url,true);
		$V0v5vsnfxezw->compare('bu_name',$this->bu_name,true);

		return new CActiveDataProvider($this, array(
			'criteria'=>$V0v5vsnfxezw,
		));
	}
}